<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
    </style>
</head>

<body>
    <div class="card">
        <div class="card-header" id="card-title"></div>
        <div class="card-body">
            <p class="card-text" id="gradeWordData"></p>
            <div id="links"></div>
        </div>
    </div>
    <script>

        $(document).ready(function () {
            let gradeData = JSON.parse(JSON.stringify(app.gradeData));
            console.log(gradeData)
            $("#card-title").html(gradeData.name);
            const code = gradeData.code;
            $.get("/resource/data/grade/" + code + ".json", function (result, status) {
                let hzArr = [];
                const data = result.data;
                for (let str of data) {
                    if ((/[\u4e00-\u9fa5]/).test(str)) {
                        hzArr.push(str);
                    }
                }
                $("#gradeWordData").html(hzArr.join(","));
                $("#links").html(
                `
                    <a href="/page/zitie.html?code=`+ code + `" class="btn btn-success btn-sm">字帖</a>
                    <a href="/page/bishun.html?code=`+ code + `" class="btn btn-primary btn-sm">练字</a>
                `
                );
                app.gradeWordData = hzArr;
            });
        });
    </script>
</body>

</html>